home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 019a / amac40.zip / PAUSE10.QM < prev    next >
Text File  |  1991-07-11  |  15KB  |  292 lines

  1. *                               PAUSE10.QM                      July 10, 1991
  2. *                      Macros To Single Step Macros
  3. *                        Written by Tom Hogshead
  4. *                   With Contributions by John Goodman
  5. *
  6. * ┌───────────────────[ (Index) of Single Step Macros ]──────────────────────┐
  7. * │   @(1) Single Step Macro By Adding PAUSE Lines Between Macro Commands
  8. * │
  9. * │   @(2) Remove PAUSE Lines Between Macro Commands Placed With @1
  10. * │
  11. * │   @(3) Macro @2 Paused With @1, Removes PAUSES "Single Step"
  12. * │
  13. * │   @(4) Adds A PAUSE*+ Above The Cursor Line, or Comments/Uncomments
  14. * │        a PAUSE*+ Line
  15. * │
  16. * │      (Description)
  17. * │      (AMACxx).ZIP
  18. * │      (Problems) or suggestions?
  19. * │
  20. * └─────[ be sure to leave at least one blank line at end of Index  ]────────┘
  21.  
  22.  
  23.  
  24. *  (Description)
  25. *  -------------
  26. *   PAUSE10.QM macros make any portion of a QEdit macro marked as a
  27. *   block a "single step" macro by entering a "pause" before the each
  28. *   macro command in the block. Macros are included to revert a single
  29. *   step macro to normal operation.
  30.  
  31.  
  32. * 
  33. *  (AMACxx).ZIP Sources
  34. *   --------------------
  35. *   AMACxx.ZIP is a collection of QEdit  macros I have put together. Many
  36. *   I   have   written,  and  John   Goodman  has   recently  contributed
  37. *   extensively to this  effort.  As of this  writing, the latest version
  38. *   is xx=38 with new macros and subsequent changes in  AMAC-x.ZIP(x = K)
  39. *   Program files used with these  macros are in AMAC-PRG.ZIP. AMACxx.ZIP
  40. *   is (uploaded) to   CompuServe IBMAPP Lib  0  (Lib 1  after 30 days in
  41. *   Lib 0), Exec-PC  (414-789-4210), and SemWare  (404-641-8968). All are
  42. *   PC "Pursuitable" except CompuServe.
  43.  
  44. * 
  45. *  (Problems) or suggestions?
  46. *   --------------------------
  47. *   Any problems  or suggestion,  I would like to  hear from  you.  I can
  48. *   be reached daily on either  SemWare,  Exec-PC  or  NewWare.   I check
  49. *   CompuServe only once a month.  I will also try to include your useful
  50. *   macros in AMAC  if you send them to me.  Hope you  find some of these
  51. *   macros useful.  I have enjoyed writing them.  Thanks.
  52.  
  53. *   Tom Hogshead
  54.  
  55. * 
  56. * ----------------------------------------------------------------------
  57. * @(1) Single Step Macro By Adding PAUSE Lines Between Macro Commands
  58. * ----------------------------------------------------------------------
  59.  
  60. * This macro makes any portion of a macro marked as a block a 'single
  61. * step' macro by entering a 'pause' before the each macro command in
  62. * the block. To run, place the cursor line on the first line of the
  63. * block, execute the macro, and at the pause, cursor down to the
  64. * desired end of block and hit Enter. Alternatively, the block may be
  65. * marked (open or closed) before execution as either a line, column or
  66. * character block.
  67.  
  68. * Insert must be set ON. Lines containing a colon are assumed Labels
  69. * and are not paused. Macro stops if any blank line exists in block.
  70. * Lines containing Pause with capital 'P' will not be paused, but pause
  71. * without capital P will be paused. Lines containing PAUSE*+ will not be
  72. * paused. Conditional lines containing jtrue, jfalse and jump are
  73. * assumed to be followed on the same line by a Label *with* a colon and
  74. * are not paused, e.g. 'jtrue LABEL1:' is not paused, but 'jtrue' with
  75. * the label on the following line is.
  76.  
  77. @1 macrobegin
  78. * ------- Check and finish marking line or block if not marked -------*
  79.     gotoblockend                * Test if block is closed
  80.     jtrue OK:                   * If closed, go to OK
  81.     markline                    * If not closed, close or start mark
  82.     gotoblockend                * Move to end of block if closed or stay
  83.                                 *  where we are if block not yet closed
  84.     jtrue OK:                   * If block is now closed, we started with
  85.                                 *  an open block
  86.     makectrofscreen             * Center for viewing
  87.     Pause                       * Pause to mark end of block
  88.     markline                    * Mark end of block
  89.  OK:                            *
  90. * ------------------ Insert blank line under block ------------------*
  91.     cursordown                  * Move down to line under block
  92.     insertline                  * Add blank line
  93. * ------------------ Insert message on top of block ------------------*
  94.  BEGIN:                         *
  95.     gotoblockbeg                * Go back to block begin
  96.     unmarkblock                 * Un mark block
  97.     begline                     * Start message in col 1
  98.     insertline                  * Insert blank line on top of block for msg
  99.     #42                         * Insert star in col 1
  100.     cursorright                 * Move right one space
  101.     "-" 8                       * Insert '-' 9 times
  102.     "BEGIN PAUSE"               * Insert begin message
  103.     wordleft                    * Move cursor to P
  104.     markcharacter               * Start character marking
  105.     endline                     *
  106.     #42 "+"                     * Inert '*+'
  107.     storescrbuff "1" return     * Store 'PAUSE_*+' to scratch buff 1
  108.     markline                    * Markline for copy
  109.     copy                        * Copy
  110.     cursordown                  * Move to first line in block
  111.     cursordown                  * Move to second line in block
  112. * --------------------- Test if at end of block ---------------------*
  113.  LOOP:                          * Come here to loop
  114.     unmarkblock                 * Unmark line/block
  115.     endline begline             * Test if line is blank
  116.     jfalse END:                 * If so, macro ends on first blank line
  117. * --------------- Test if star is first character in line-------------*
  118.     insertline                  * Insert temp line                        |
  119.     nextpara                    * Move to first character of line below   |
  120.     cursorup delline            * Delete temp line                        |
  121.     scrollup                    * Re-position screen because of delete    |b
  122.     cursorright                 * Move right one space off first character |a
  123.     markline                    * Mark this line to begin all tests        |
  124.     FIND #42 return "LB" return * Search for star, Local Backwards         |
  125.     jtrue 1:                    * If false, no comment in line, go pause
  126. * ----------- Test if conditional statement or label (colon) -----------*
  127.     begline                     * In case previous line contained comments
  128.     Find #58  return            * Search for colon #58
  129.     "L" return                  *  in this line only, "Local"
  130.     Jtrue 1:                    * If colon found, line assumed to be a
  131.                                 *  conditional statement or Label, bypass
  132. * -------------------- Test if line is already a 'pause' -------------*
  133.     begline                     *ELSE line has no colon, position to Test
  134.     Find #80 "ause" return      * Test if line is already a paused
  135.     "WL" return                 *  Finds whole word pause, with cap P
  136.     jtrue 2:                    * If found, line is a pause, bypass this
  137.                                 *  and next line
  138. * -------------- Test if line is already paused with @1 --------------*
  139.     begline                     *ELSE line has no colon, position to Test
  140.     Find "E" "*+" return        * Test if line is already paused with @1
  141.     "L" return                  *  Finds 'PAUSE_*+', all caps
  142.     jtrue 2:                    * If found, line was paused with @1,
  143.                                 *  bypass this and next line
  144. * --------------------- Test if line has Repeat_Cmd --------------------*
  145.     begline                     * In case previous line contained comments
  146.     Find "atcm"  return         * Search for Repeat_Cmd
  147.     "IL" return                 *  in this line only, Local, Case Insensitive
  148.     Jtrue 1:                    * If  found, line, bypass this line
  149. * ----------------------- Insert 'pause' line -----------------------*
  150.  3:                             *
  151.     insertline                  * Need to insert a blank line to 'pause'
  152.     Gotocolumn  "25" return     * Go to column 25 (change as you like)
  153.     getscrbuff "1" return       * Insert needed 'PAUSE_*+' from scratch
  154.  2:                             *
  155.     cursordown                  * Bypass line, move down to next line
  156.  1:                             *
  157.     cursordown                  * Move down to next line to test if blank
  158.     endline begline             * Test if line is blank
  159.     jfalse END:                 * If so, blank line ends macro
  160.     jump LOOP:                  *ELSE loop again
  161.  END:                           * End macro
  162. * -------------------- Insert message under block --------------------*
  163.     paste                       * Paste Begin message here
  164.     endline                     * Move to eol
  165.     wordleft wordleft           * Move to B in BEGIN
  166.     delrtword                   * Delete BEGIN
  167.     "END "                      * BEGIN now replaced with END,
  168.                                 * Insert must ON
  169.     unmarkblock                 *
  170. *
  171. * 241 bytes Wed  05-29-1991  21:20:35 (TH to JG)
  172. * 207 bytes Tue  06-04-1991  00:39:02 (TH implemented JG suggestions)
  173. * 194 bytes Tue  06-04-1991  10:38:13 (TH |a, shortened test for comments)
  174. * 194 bytes Sun  06-23-1991  20:59:30 (TH |b, changed find first char on line)
  175. * 194 bytes Mon  07-08-1991  17:16:28 (TH @1)
  176.  
  177. * 
  178. * ----------------------------------------------------------------------
  179. * @(2) Remove PAUSE Lines Between Macro Commands Placed With @1
  180. * ----------------------------------------------------------------------
  181.  
  182. * This macro removes all and only pauses placed with @1 from the
  183. * cursor line to the next blank line. If no PAUSE_*+ are found after
  184. * starting this macro, it does stop and delete the next blank line
  185. * it finds. Just beware.
  186.  
  187. @2 macrobegin
  188.  LOOP:
  189.     endline begline             * Test if line has text                   |
  190.     jfalse DELLINE:             * If blank, END macro                     |
  191.     unmarkblock markline        * Markline for Find                       |
  192.     Find  "E" "*+" return       * Search for 'PAUSE_*+'
  193.     "L" return                  * Finish prompt                           |
  194.     jfalse NOPAUSE:             * If not found, go to NOPAUSE
  195.     delline                     *ELSE if found, delete pause line
  196.     begline                     * Re-position for Find on current line
  197.     jump LOOP:                  * Loop again
  198.  NOPAUSE:                       *
  199.     endline begline             * Test if line has text
  200.     jfalse DELLINE:             * If blank, delete line and end macro
  201.     unmarkblock                 * Only for better screen appearance       |
  202.     cursordown                  *ELSE cursor down to next line
  203.     JFALSE END:                 * End macro if can't cursor down bottom line
  204.     jump LOOP:                  * Loop again
  205.  DELLINE:                       *
  206.     delline                     * Delete blank line
  207.  END:                           *
  208.     unmarkblock                 *                                         |
  209. *
  210. * 36 bytes Tue  06-04-1991  00:26:13 (TH)
  211. * 44 bytes Tue  06-04-1991  10:14:23 (TH |)
  212. * 45 bytes Mon  07-08-1991  17:16:43 (TH @2)
  213.  
  214. * 
  215. * ----------------------------------------------------------------------
  216. * @(3) Macro @2 Paused With @1, Removes PAUSES "Single Step"
  217. * ----------------------------------------------------------------------
  218.  
  219. * This macro is macro @2 paused with @1.
  220.  
  221. @3 macrobegin
  222. * --------BEGIN PAUSE*+
  223.     begline                     * In case cursor past 'PAUSE_*+' on line
  224.                         PAUSE*+
  225.  LOOP:
  226.                         PAUSE*+
  227.     Find "E" "*+" return        * Search for 'PAUSE_*+' (all capitals)
  228.                         PAUSE*+
  229.     delline return              * Finish prompt
  230.     jfalse NOPAUSE:             * If nor found, go to NOPAUSE
  231.                         PAUSE*+
  232.     delline                     *ELSE if found, delete pause line
  233.     jump LOOP:                  * Loop again
  234.  NOPAUSE:                       *
  235.                         PAUSE*+
  236.     endline begline             * Test if line has text
  237.     jfalse DELLINE:             * If blank, delete line and end macro
  238.                         PAUSE*+
  239.     cursordown                  *ELSE cursor down to next line
  240.     JFALSE END:                 * End macro if can't cursor down bottom line
  241.     jump LOOP:                  * Loop again
  242.  DELLINE:                       *
  243.                         PAUSE*+
  244.     delline                     * Delete blank line
  245.  END:                           *
  246. * --------END PAUSE*+
  247.  
  248. * 42 bytes Fri  05-31-1991  22:13:40 (TH)
  249. * 42 bytes Mon  07-08-1991  17:16:52 (TH @3)
  250.  
  251.  
  252. * 
  253. * ----------------------------------------------------------------------
  254. * @(4) Adds A PAUSE_*+ Above The Cursor Line, or Comments/Uncomments
  255. *      a PAUSE_*+ Line
  256. * ----------------------------------------------------------------------
  257.  
  258. * This macro either adds a PAUSE_*+ above the cursor line, or
  259. * comments/ uncomments a PAUSE_*+ line.
  260.  
  261. @4  macrobegin
  262.     unmarkblock                 *
  263.     begline                     *
  264.     markline                    *
  265.     Find "*" " P" return        * Test if pause commented
  266.     "L" return                  *  Locally
  267.     jfalse DO:                  * If false, commented pause does not exist
  268.     delch                       *ELSE, it exists, delete star
  269.     shiftright                  * Put pause back in original position
  270.     jump END:                   * END macro
  271.  DO:                            *
  272.     Find "E" "*+" return        * Test if 'pause' with '*+' exists
  273.     "L" return                  *  Locally
  274.     jfalse ADD:                 * If it does not, we must add pause
  275.     wordleft                    *ELSE 'pause' with '*+' exists
  276.     shiftright                  * Shift it and line right one space
  277.     "*"                         * Insert star
  278.     shiftleft shiftleft         * Put back in original position if Insert ON
  279.     jump END:                   * END macro
  280.  ADD:                           *
  281.     insertline                  * Insert line above for 'pause'
  282.     Gotocolumn "25" return      * Go to column 25 (change as you like)
  283.     "PAUSE" "*+"                * Insert 'pause' with '*+'
  284.     cursordown                  * Cursor down to line we just paused
  285.  END:                           *
  286.     begline                     *
  287.     unmarkblock                 *
  288. *
  289. * 73 bytes Tue  06-04-1991  02:04:12 (TH)
  290. * 73 bytes Mon  07-08-1991  17:17:12 (TH @4)
  291.  
  292.